<template>
  <div class="newdetail">
    <Title></Title>
    <div class="newdetailbox">
        <div class="inner">
            <div class="newdetailtit">
             {{newdetail.news_name}}
            </div>
            <div class="newdetail_view">
              <span>{{newdetail.create_time_text}}</span>
              <span>{{newdetail.view_num}}次</span>
            </div>
            <div class="newdetail_content" v-html="newdetail.news_content">
            </div>
        </div>
    </div>
  </div>
</template>

<script>
import Title from "../../components/title.vue"
import {newdetailapi} from "../../api/http.js"
export default {
  name: 'newdetail',
  components:{
    Title
  },
  data(){
    return{
      newdetail:[]
    }
  },
 async created() {
   const res =await newdetailapi({news_id:this.$route.query.id})
   console.log(res.data.data);
   if(res.data.code==200){
    this.newdetail= res.data.data
   }else{
      this.newdetail=[]
   }
    console.log(res);
  }
}
</script>

<style lang="less">
  .newdetailbox{
    width: 100%;
      .inner{
        width: 1300px;
        margin: 0 auto;
        padding: 10px 85px;
        box-sizing: border-box;
        .newdetailtit{
          text-align: center;
          font-weight: 400;
          font-size: 16px;
          height: 40px;
          line-height: 40px;
          color: #292929;
          font-weight: 600;
          margin-bottom: 15px;
        }
        .newdetail_view{
          width: 100%;
          display: flex;
          justify-content: center;
          height: 40px;
          align-items: center;
          span{
            color: #9A9A9A;
            height: 40px;
            line-height: 40px;
            margin: 0 80px;
          }
        }
        .newdetail_content{
          background: #F3F3F3;
          border: 1px solid #F3F3F3;
          padding:50px 10px;
            img{
              width: 100%;
            }
        }
      }
  }

</style>
